Skip to content

redpanda: various test fixes#4311

Open
mmatczuk wants to merge 2 commits intomainfrom
mmt/redpanda-fixes-v2
Open

redpanda: various test fixes#4311
mmatczuk wants to merge 2 commits intomainfrom
mmt/redpanda-fixes-v2

Conversation

@mmatczuk
Copy link
Copy Markdown
Contributor

Commits

  • fix data race on TestingOnSetSubjectMode callback
  • fix flaky chaos tests after container restart

Jira

  • CON-410
  • CON-417

importModeManager.Close() restores subject modes concurrently via
errgroup. Each goroutine calls setSubjectMode() which invokes the
TestingOnSetSubjectMode callback. Serialize callback invocations
with a dedicated mutex to prevent data races in test callbacks
that write to shared state.

Fixes CON-410
Pin the Kafka host port so it survives container stop/start and
kill/start cycles. Without pinning, Docker assigns a new random port on
restart, but the Redpanda config inside the container still advertises
the old port, causing Kafka clients to reconnect to a dead address.

Also replace fixed 2s sleep before chaos with require.Eventually that
waits for both producer and consumer to confirm message flow, and add
a TCP readiness check after every broker restart.

Extend redpandatest.Config with ExtraOpts to allow passing additional
testcontainers options, so the chaos tests reuse
StartSingleBrokerWithConfig instead of duplicating container setup.

Fixes CON-417
@claude
Copy link
Copy Markdown

claude Bot commented Apr 20, 2026

Commits
LGTM

Review
Test-only changes plus a narrow data-race fix around a testing-only callback. Port pinning, readiness waits, and ExtraOpts are clean and focused.

LGTM

This was referenced Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant